var userMenuOpen = false;
var adminMenuOpen = false;

function toggleUserMenu() {
	if( userMenuOpen ) {
		userMenuOpen = false;
		hideMenu( document.getElementById('usermenu') );
	} else {
		if( adminMenuOpen ) {
			toggleAdminMenu();
		}
		userMenuOpen = true;
		showMenu( document.getElementById('usermenu') );
	}
}

function toggleAdminMenu() {
	if( adminMenuOpen ) {
		adminMenuOpen = false;
		hideMenu(document.getElementById('adminmenu') );
	} else {
		if( userMenuOpen ) {
			toggleUserMenu();
		}
		adminMenuOpen = true;
		showMenu( document.getElementById('adminmenu') );
	}
}

function hideMenu( element ) {
	element.style.display = 'none';
}

function showMenu( element ) {
	element.style.display = '';
}